﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace Bzure.Security.Principal
{
    /// <summary>
    /// 密码找回令牌
    /// </summary>
    public class PasswordToken : Bzure.Common.Core.Entity, Bzure.Common.Core.IPersistenceState
    {
        /// <summary>
        /// 令牌
        /// </summary>
        [DataMember]
        public string Token { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [DataMember]
        public string UserName { get; set; }
        /// <summary>
        /// 令牌创建时间
        /// </summary>
        [DataMember]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 过期时间
        /// </summary>
        [DataMember]
        public DateTime Expire { get; set; }
        public bool IsOutTime
        {
            get
            {
                return DateTime.Now > Expire;
            }
        }

    }
}
